package com.itheima.a01;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class Component3 {

    private static final Logger log = LoggerFactory.getLogger(Component3.class);

    /**
     * 这个监听器的监听所有的事件类型
     * ApplicationEvent 事件的监听器，只能有一个参数且类型必须是ApplicationEvent类或其子类
     * @param applicationEvent
     */
    @EventListener
    public void bbb(ApplicationEvent applicationEvent) {
        log.info("这个监听器的监听所有的事件类型==>> " + applicationEvent.getClass() + " source ==>> " + applicationEvent.getSource());
    }
}
